core: Reduce API surface for file access
authorColin Walters <walters@verbum.org>
Wed, 31 Jul 2013 00:56:33 +0000 (20:56 -0400)
committerColin Walters <walters@verbum.org>
Wed, 31 Jul 2013 04:35:53 +0000 (00:35 -0400)
This function was only used by internals, make it private.

src/libostree/ostree-repo-checkout.c
src/libostree/ostree-repo-file.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h

index 63f54d356cf5c4caa18998e2ac21b515b58085d1..51dbedabd2caec597b517e38ca458661e1b6807b 100644 (file)
@@ -189,7 +189,7 @@ find_loose_for_checkout (OstreeRepo             *self,
           path = ostree_repo_get_object_path (self, checksum, OSTREE_OBJECT_TYPE_FILE);
           break;
         case OSTREE_REPO_MODE_ARCHIVE:
-          path = ostree_repo_get_archive_content_path (self, checksum);
+          path = _ostree_repo_get_archive_content_path (self, checksum);
           break;
         case OSTREE_REPO_MODE_ARCHIVE_Z2:
           {
index 2b8e2438910c2ecaa076e425090310f589cfac77..352ace7f8c722a846b664706ebd5feb1f70a53e6 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "otutil.h"
 #include "ostree-repo-file-enumerator.h"
-#include "ostree-repo.h"
+#include "ostree-repo-private.h"
 
 static void ostree_repo_file_file_iface_init (GFileIface *iface);
 
@@ -365,7 +365,7 @@ ostree_repo_file_tree_get_content_checksum (OstreeRepoFile  *self)
 GFile *
 ostree_repo_file_nontree_get_local (OstreeRepoFile  *self)
 {
-  return ostree_repo_get_file_object_path (self->repo, ostree_repo_file_get_checksum (self));
+  return _ostree_repo_get_file_object_path (self->repo, ostree_repo_file_get_checksum (self));
 }
 
 /**
index 40793ab246c5c3793f4e5bb6ac402db5a1579742..30a6b01d5b9ed729947c909a6a3dcba2002abe8e 100644 (file)
@@ -65,6 +65,14 @@ GFile *
 _ostree_repo_get_uncompressed_object_cache_path (OstreeRepo       *self,
                                                  const char       *checksum);
 
+GFile *
+_ostree_repo_get_archive_content_path (OstreeRepo    *self,
+                                       const char    *checksum);
+
+GFile *
+_ostree_repo_get_file_object_path (OstreeRepo   *self,
+                                   const char   *checksum);
+
 gboolean
 _ostree_repo_stage_directory_meta (OstreeRepo   *self,
                                    GFileInfo    *file_info,
index acc3d157688bfa18c4a8895a11ec8676a02a343e..9e403739d77fb53159467b1de05be1ec0f899b22 100644 (file)
@@ -422,38 +422,16 @@ ostree_repo_get_parent (OstreeRepo  *self)
   return self->parent_repo;
 }
 
-/**
- * ostree_repo_get_file_object_path:
- * @self:
- * @checksum: SHA256 checksum string
- *
- * This function directly retrieves the path of loose objects; it is a
- * low level API as one cannot assume that all objects are loose.  Use
- * higher level API such as ostree_repo_load_file() if possible.
- *
- * Returns: (transfer full): A new file containing the direct path to a loose object
- */
 GFile *
-ostree_repo_get_file_object_path (OstreeRepo   *self,
-                                  const char   *checksum)
+_ostree_repo_get_file_object_path (OstreeRepo   *self,
+                                   const char   *checksum)
 {
   return ostree_repo_get_object_path (self, checksum, OSTREE_OBJECT_TYPE_FILE);
 }
 
-/**
- * ostree_repo_get_archive_content_path:
- * @self:
- * @checksum: SHA256 checksum string
- *
- * This function directly retrieves the path of loose objects; it is a
- * low level API as one cannot assume that all objects are loose.  Use
- * higher level API such as ostree_repo_load_file() if possible.
- *
- * Returns: (transfer full): A new file containing the direct path to a loose object
- */
 GFile *
-ostree_repo_get_archive_content_path (OstreeRepo    *self,
-                                      const char    *checksum)
+_ostree_repo_get_archive_content_path (OstreeRepo    *self,
+                                       const char    *checksum)
 {
   gs_free char *path = NULL;
 
@@ -759,7 +737,7 @@ stage_object (OstreeRepo         *self,
             {
               gs_unref_object GFile *archive_content_dest = NULL;
 
-              archive_content_dest = ostree_repo_get_archive_content_path (self, actual_checksum);
+              archive_content_dest = _ostree_repo_get_archive_content_path (self, actual_checksum);
                                                                    
               if (!commit_loose_object_impl (self, raw_temp_file, archive_content_dest, TRUE,
                                              cancellable, error))
@@ -2129,7 +2107,7 @@ ostree_repo_load_file (OstreeRepo         *self,
                 gs_unref_object GFile *archive_content_path = NULL;
                 gs_unref_object GFileInfo *content_info = NULL;
 
-                archive_content_path = ostree_repo_get_archive_content_path (self, checksum);
+                archive_content_path = _ostree_repo_get_archive_content_path (self, checksum);
                 content_info = g_file_query_info (archive_content_path, OSTREE_GIO_FAST_QUERYINFO,
                                                   G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                                   cancellable, error);
index 5ff232c38a4dcfdb4362a1e433013baa8bce2074..a8fb6cb2b3c2784de2f1505e8d2a705fcafe77bc 100644 (file)
@@ -69,12 +69,6 @@ GFile *       ostree_repo_get_object_path (OstreeRepo   *self,
                                            const char   *checksum,
                                            OstreeObjectType type);
 
-GFile *       ostree_repo_get_archive_content_path (OstreeRepo    *self,
-                                                    const char    *checksum);
-
-GFile *       ostree_repo_get_file_object_path (OstreeRepo   *self,
-                                                const char   *checksum);
-
 gboolean      ostree_repo_prepare_transaction (OstreeRepo     *self,
                                                gboolean        enable_commit_hardlink_scan,
                                                gboolean       *out_transaction_resume,